import { createRouter, createWebHistory } from "vue-router";
import Layout from "@/views/layout/Layout.vue";
import Login from "@/views/login/Login.vue";
import Home from "@/views/Home/Home.vue";
import Category from '@/views/Category/Category.vue'

const router = createRouter({
	history: createWebHistory(import.meta.env.BASE_URL),
	routes: [
		{
			path: "/",
			component: Layout,
			children: [
				{
					// 默认渲染页，路由置空=>访问/时Home也会渲染
					path:'',
					component: Home
				},
				{
					path: '/category',
					component: Category
				}
			],
		},
		{
			path: "/login",
			component: Login,
		},
	],
});

export default router;
